﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PlayingCards.Model.Result
{
    /// <summary>
    /// 处理结果
    /// </summary>
    public class Result
    {
        /// <summary>
        /// 是否成功
        /// </summary>
        public bool Status { get; set; } = true;
        private string _message;
        /// <summary>
        /// 提示消息
        /// </summary>
        public string Message
        {
            get
            {
                if (Status)
                {
                    return string.IsNullOrEmpty(_message) ? "成功" : _message;
                }
                else
                {
                    return string.IsNullOrEmpty(_message) ? "错误" : _message;
                }
            }
            set { _message = value; }
        }
    }
    public class Result<T> : Result
    {
        /// <summary>
        /// 处理结果
        /// </summary>
        public T Data { get; set; }
    }
    public class ResultList<T> : Result
    {
        /// <summary>
        /// 处理结果
        /// </summary>
        public List<T> Data { get; set; }
    }
    public class ResultPageList<T> : Result
    {
        /// <summary>
        /// 总条数
        /// </summary>
        public int TotalCount { get; set; }
        /// <summary>
        /// 处理结果
        /// </summary>
        public List<T> Data { get; set; }
    }
}
